#include <stdio.h>
#include <stdlib.h>
#include <include/cstl.h>

bool g_cstl_have_init = false;

/**
* Init memory manager and type manager.
*/
bool cstl_init()
{
    if (g_cstl_have_init)
    {
        return true;
    }

    // PRINT_FUN();

    if (!memmanager_init())
    {
        fprintf(stderr, "memory manager init failed!\n");
        exit(1);
    }

    g_cstl_have_init = true;

    return true;
}

/**
* Destroy memory manager and type manager.
*/
void cstl_exit()
{
    if (g_cstl_have_init)
    {
        memmanager_exit();
        g_cstl_have_init = false;
    }
}

